/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_promociones_detalle.java
 *
 * Created on 19/09/2011, 04:41:59 PM
 */

package sie_invdis;


import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;

/**
 *
 * @author Michelle
 */
public class articulos_sie_promociones_detalle extends javax.swing.JFrame {

    bd_conexion x = new bd_conexion() ;
    //se creaa la variable resultset
    ResultSet rs = null;
    private int buscamp=0,indexactual=0,yacarguedistrifotos=0,columnavisualisa2=0,columnavisualisa1=0,yacargueestadistica=0;
    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_fotos;
    private javax.swing.table.DefaultTableModel jtable_modelo_articyestadis;
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");


    /** Creates new form articulos_sie_promociones_detalle */
    public articulos_sie_promociones_detalle() {
        initComponents();
    }

public articulos_sie_promociones_detalle(String folio) {
    this.iniciar_modelo_de_tabla();
    this.iniciar_modelo_distrifotos();
    this.iniciar_modelo_artiyesta();
        initComponents();
        this.carga_datos_promociones(1, folio);
        this.executabusqueda(0, folio);

    jtb_catalogo_articulos.getColumnModel().getColumn(0).setPreferredWidth(60);//tem ent/venta
    jtb_catalogo_articulos.getColumnModel().getColumn(1).setPreferredWidth(90);//fam/subfam
    jtb_catalogo_articulos.getColumnModel().getColumn(2).setPreferredWidth(60);//id/clave
    jtb_catalogo_articulos.getColumnModel().getColumn(3).setPreferredWidth(80);//descripcion
    jtb_catalogo_articulos.getColumnModel().getColumn(4).setPreferredWidth(35);//linea
    jtb_catalogo_articulos.getColumnModel().getColumn(5).setPreferredWidth(45);//costo/precio
    jtb_catalogo_articulos.getColumnModel().getColumn(6).setPreferredWidth(45);//f.ult.compra
    jtb_catalogo_articulos.getColumnModel().getColumn(7).setPreferredWidth(45);//pzas promo
    jtb_catalogo_articulos.getColumnModel().getColumn(8).setPreferredWidth(45);//costo/precio
    jtb_catalogo_articulos.getColumnModel().getColumn(9).setPreferredWidth(50);//observacion

    jtbl_distribucionfotos.getColumnModel().getColumn(0).setPreferredWidth(60);//Codigo
    jtbl_distribucionfotos.getColumnModel().getColumn(1).setPreferredWidth(150);//Descripcion
    jtbl_distribucionfotos.getColumnModel().getColumn(2).setPreferredWidth(60);//Item
    jtbl_distribucionfotos.getColumnModel().getColumn(3).setPreferredWidth(10);//Un. entrada
    jtbl_distribucionfotos.getColumnModel().getColumn(4).setPreferredWidth(200);//Factor

    this.buttonGroup2.setSelected(jrbtn_columnaclave1.getModel(), true);
    this.buttonGroup1.setSelected(jrbtn_columnaclave2.getModel(), true);


         jt_articulosestadisticas.getColumnModel().getColumn(0).setPreferredWidth(60);//tem ent

         jt_articulosestadisticas.getColumnModel().getColumn(1).setPreferredWidth(60);//familia
         jt_articulosestadisticas.getColumnModel().getColumn(2).setPreferredWidth(10);//id
         jt_articulosestadisticas.getColumnModel().getColumn(3).setPreferredWidth(55);//clave
         jt_articulosestadisticas.getColumnModel().getColumn(4).setPreferredWidth(80);//descrip.
         jt_articulosestadisticas.getColumnModel().getColumn(5).setPreferredWidth(55);//item
         jt_articulosestadisticas.getColumnModel().getColumn(6).setPreferredWidth(35);//linea
         jt_articulosestadisticas.getColumnModel().getColumn(7).setPreferredWidth(10);//costo
         jt_articulosestadisticas.getColumnModel().getColumn(8).setPreferredWidth(10);//precio
         jt_articulosestadisticas.getColumnModel().getColumn(9).setPreferredWidth(35);//f.ult. compra
         jt_articulosestadisticas.getColumnModel().getColumn(10).setPreferredWidth(10);//p vendida
         jt_articulosestadisticas.getColumnModel().getColumn(11).setPreferredWidth(10);//exixtencia
         jt_articulosestadisticas.getColumnModel().getColumn(12).setPreferredWidth(15);//rotacion
         


    }

private void iniciar_modelo_de_tabla()
    {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Temp. Ent./Venta</b></html>");
        jtable_modelo.addColumn("<html><b>Familia/sub familia</b></html>");
        jtable_modelo.addColumn("<html><b>Id/Clave</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion/Item</b></html>");
        jtable_modelo.addColumn("<html><b>Linea</b></html>");
        jtable_modelo.addColumn("<html><b>Costo/Precio</b></html>");
        jtable_modelo.addColumn("<html><b>F. Ult.Compra</b></html>");
        jtable_modelo.addColumn("<html><b>Pzas Promo</b></html>");
        jtable_modelo.addColumn("<html><b>Imp.Costo/Precio</b></html>");
        jtable_modelo.addColumn("<html><b>Observaciones</b></html>");
    }
private void iniciar_modelo_distrifotos()
    {
        jtable_modelo_fotos=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_fotos.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Item</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Foto</b></html>");
   }

 private void iniciar_modelo_artiyesta()
    {
        jtable_modelo_articyestadis=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_articyestadis.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>subfamilia</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Id</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Item.</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Linea.</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>F.Compra</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>P.Vendidas</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Exist.</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Rot.</b></html>");
        jtable_modelo_articyestadis.addColumn("<html><b>Foto</b></html>");

   }
private void carga_datos_promociones(int opbus,String tbusca)
{
       String fechacat = "",fechaorigen="",fechaentrega="";
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       String cadenasql="select * from x1sieuno_articulo_promociones_catalogo("+opbus+",'"+tbusca+"') as (id integer,fechaprog date,fechaplica date,fecharevision date,fechainipromo date,fechafinpromo date,descrippromo text,observa text,idstatus smallint,idsuperviso integer,canexispromo numeric,importeexiscosto numeric,importeexisprecio numeric,cantvenacum numeric,importecostoacum numeric,importeprecioacum numeric,describestatus text,supnombre character varying(50),supapaterno character varying(50),supamaterno character varying(50),diaspromo integer);";
       //invoco al metodo que trae el recordset de datos
       System.out.println(cadenasql);

        try
         {
            rs = x.sieuno_executediversosv2(cadenasql,variables_global.getconexiongral());
            while (rs.next())
                {
                    this.tf_status.setText(rs.getString("idstatus")+":"+rs.getString("describestatus"));
                    this.jtf_folio.setText(rs.getString("id"));
                    this.jtf_descripcion.setText(rs.getString("descrippromo"));
                    this.jtf_fechaaplica.setText(this.fechaeuropea(rs.getString("fechaplica"))+" "+DiaSemana(this.fechaeuropea(rs.getString("fechaplica"))).substring(0, 3));
                    this.jtf_fechainicio.setText(this.fechaeuropea(rs.getString("fechainipromo"))+" "+DiaSemana(this.fechaeuropea(rs.getString ("fechainipromo"))).substring(0, 3));
                    this.jtf_fechafinal.setText(this.fechaeuropea(rs.getString("fechafinpromo"))+" "+DiaSemana(this.fechaeuropea(rs.getString ("fechafinpromo"))).substring(0, 3));
                    this.jtf_piezaspromo.setText(miformat.format(rs.getFloat("canexispromo")));
                    this.jtf_importecostopromo.setText(miformat.format(rs.getFloat("importeexiscosto")));
                    this.jtf_importeprecio.setText(miformat.format(rs.getFloat("importeexisprecio")));
                    this.jtf_piezasacumvendidas.setText(miformat.format(rs.getFloat("cantvenacum")));
                    this.jtf_importeacumvendcosto.setText(miformat.format(rs.getFloat("importecostoacum")));
                    this.jtf_acumventimporprecio.setText(miformat.format(rs.getFloat("importecostoacum")));
                    this.jep_observaciones.setText(rs.getString("observa"));
                }
        }
        catch(Exception e)
        {
                System.out.println(e.getMessage());
        }
}
private void executabusqueda(int bus,String busqueda)
 {
      Object[] fnewRow = new Object[10];
      Object[] fnewRowf = new Object[5];
      DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
      String texto="select * from x1sieuno_articulo_promociones_detalle("+bus+",'"+busqueda+"') as (idreg integer,iddocto integer,clavearticulo character varying(16),exispiezaspromo numeric,exiscostopromo numeric,exispreciopromo numeric,pzvendacumpromo numeric,costovenacumpromo numeric,preciovenacumpromo numeric,obseva text,idpro integer,cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(20),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,controalmacen character varying(20),statusarticulo smallint,unidadempaque character varying(8),sublinea smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),describestatus character varying(25),describesublinea character varying(25),describetemventa character varying(25))";

       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                  fnewRow[0]="<html>"+rs.getString ("tementr")+"<br>"+rs.getString ("describetemventa")+"</html>";
                  fnewRow[1]="<html>"+rs.getString ("fa")+":"+rs.getString ("nomfa")+"<br>"+rs.getString("sub")+":"+rs.getString("nomsub")+"</html>";
                  fnewRow[2]="<html>"+rs.getString("idpro")+"<br>"+rs.getString("clavearticulo")+"</html>";
                  fnewRow[3]="<html>"+rs.getString ("des")+"<br>"+rs.getString ("it")+"</html>";
                  fnewRow[4]=rs.getString ("descriplinea");
                  fnewRow[5]="<html>"+miformat.format(rs.getFloat("ultimocosto"))+"<br>"+miformat.format(rs.getFloat("pre"))+"</html>";
                  fnewRow[6]=this.fechaeuropea(rs.getString("fe"));
                  fnewRow[7]="<html>"+miformat.format(rs.getFloat("exispiezaspromo"))+"</html>";
                  fnewRow[8]="<html>"+miformat.format(rs.getFloat("exiscostopromo"))+"<br>"+miformat.format(rs.getFloat("exispreciopromo"))+"</html>";
                  fnewRow[9]=rs.getString("ob");
                  jtable_modelo.addRow(fnewRow);
                  fnewRowf[0]=rs.getString("clavearticulo");
                  fnewRowf[1]=rs.getString("des");
                  fnewRowf[2]=rs.getString("it");
                  fnewRowf[3]="<html><b>"+miformat.format(rs.getFloat("pre"))+"</b></html>";
                  fnewRowf[4]="";
                  jtable_modelo_fotos.addRow(fnewRowf);
                }
       }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
    this.registrosobtenidos();
    this.cambiartamanofilas();
 }

private void cargar_datosarticulosexisyacum(int bus,String busqueda)
{
      //inicio proceso para informar de las promociones en cada tienda
            //INICIO PROCESO PARA INFORMAR DE LAS PROMOCIONES EN CADA TIENDA
 //inicio proceso para informar de las promociones en cada tienda
            //INICIO PROCESO PARA INFORMAR DE LAS PROMOCIONES EN CADA TIENDA
            String texto="",texto2="";
            java.util.Date fechainicial=new Date();
            ResultSet rs2 = null;
             float importe=0,importe2=0,acumulado=0,piezas=0,piezas2=0;
            DecimalFormat myForma = new DecimalFormat("###,###,###,###");
            String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";


            Object[] fnewRow = new Object[15];
                 importe=0;
            texto="select * from x1sieuno_articulo_promociones_detalle_estadistica("+bus+",'"+busqueda+"') as (idreg integer,iddocto integer,clavearticulo character varying(16),exispiezaspromo numeric,exiscostopromo numeric,exispreciopromo numeric,pzvendacumpromo numeric,costovenacumpromo numeric,preciovenacumpromo numeric,obseva text,idpro integer,cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),existencia double precision,cantidadproducto real)";

                            System.out.println(texto2);
                            try{
                                  rs2 = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                  while (rs2.next())
                                    {
                                      fnewRow[0]=""+rs2.getString("tementr")+"";
                                      fnewRow[1]=""+rs2.getString("nomfa")+"";
                                      fnewRow[2]=""+rs2.getString("nomsub")+"";
                                      fnewRow[3]=""+rs2.getString("idpro")+"";
                                      fnewRow[4]=""+rs2.getString("clavearticulo")+"";
                                      fnewRow[5]=""+rs2.getString("des")+"";
                                      fnewRow[6]=""+rs2.getString("it")+"";
                                      fnewRow[7]=""+rs2.getString("descriplinea")+"";
                                      fnewRow[8]=""+rs2.getString("ultimocosto")+"";
                                      fnewRow[9]=""+rs2.getString("pre")+"";
                                      fnewRow[10]=""+this.fechaeuropea(rs2.getString("fe"))+"";
                                      fnewRow[11]=""+rs2.getString("cantidadproducto")+"";
                                      fnewRow[12]=""+rs2.getString("existencia")+"";
                                      piezas=rs2.getFloat("cantidadproducto");
                                      piezas2=rs2.getFloat("existencia");
                                      acumulado=piezas+piezas2;
                                      importe=(piezas/acumulado)*100;
                                       colorabre="";
                                       colorcierra="";
                                    if (importe<=50)
                                        {
                                            colorabre="<b><font color=#CC0000>";
                                            colorcierra="<font></b>";
                                        }
                                    if ((importe>50) && (importe<=75))
                                            {
                                                colorabre="<b><font color=#FF6633>";
                                                colorcierra="<font></b>";
                                            }
                                      if (importe>75)
                                            {
                                                colorabre="<b><font color=#00FF00>";
                                                colorcierra="<font></b>";
                                            }
                                      fnewRow[13]=htmlabre+colorabre+myForma.format(importe)+"%"+colorcierra+htmlcierra;
                                      fnewRow[14]="";
                                      jtable_modelo_articyestadis.addRow(fnewRow);
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }



}


private String  fechaeuropea(String fecha) {
       //resibe cadena de fecha en formato americano yyyy-MM-dd
       java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;
    }
private String DiaSemana(String fe) {
       String dia = "";
       java.util.Date fecha=null;
         try
           {
             fecha = formateador.parse(fe);
           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

void registrosobtenidos()
 {
     //limpiar la tabla
    this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
    
 }
 void cambiartamanofilas()
 {
     //limpiar la tabla


       int numerofilas=this.jtable_modelo.getRowCount();

             for(int i = 0 ;i < numerofilas; i++)
                {
                    jtb_catalogo_articulos.setRowHeight(i, 30);
                }
  }

 private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogo_articulos.getSelectedRow();
         String valor[] = jtb_catalogo_articulos.getValueAt(fila, 2).toString().replace("<html>", "").replace("</html>", "").split("<br>");


        articulos_sie_editar fase=new articulos_sie_editar(valor[0]);
        fase.pack();
        fase.setVisible(true);
    }

 private void jtbl_distribucionfotosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
     
    }
 private void dioclickf(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_distribucionfotos.getSelectedColumn();
         int folio=0;
         int fila = jtbl_distribucionfotos.getSelectedRow();
         String idcadena=this.jtbl_distribucionfotos.getValueAt(fila,0).toString();
         rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
         try
                {
                while (rs.next())
                        {
                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        //setVisible(false);
    }

  private void dioclicke(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jt_articulosestadisticas.getSelectedRow();
         String valor = jt_articulosestadisticas.getValueAt(fila, 3).toString().replace("<html>", "").replace("</html>", "");


        articulos_sie_editar fase=new articulos_sie_editar(valor);
        fase.pack();
        fase.setVisible(true);
    }
    private void jt_articulosestadisticasMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel3 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jtf_descripcion = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        tf_status = new javax.swing.JTextField();
        jtf_importecostopromo = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jtf_piezaspromo = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jtf_fechaaplica = new javax.swing.JTextField();
        jtf_fechainicio = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jtf_fechafinal = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jep_observaciones = new javax.swing.JEditorPane();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jtf_importeprecio = new javax.swing.JTextField();
        jtf_piezasacumvendidas = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jtf_importeacumvendcosto = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jtf_acumventimporprecio = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jtf_folio = new javax.swing.JTextField();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_catalogo_articulos = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jLabel14 = new javax.swing.JLabel();
            jlbl_cantidadregistros = new javax.swing.JLabel();
            jLabel22 = new javax.swing.JLabel();
            jLabel23 = new javax.swing.JLabel();
            jrbtn_columnaclave1 = new javax.swing.JRadioButton();
            jRadioButton1 = new javax.swing.JRadioButton();
            jrbtn_item1 = new javax.swing.JRadioButton();
            jLabel24 = new javax.swing.JLabel();
            jtf_buscarenjtable1 = new javax.swing.JTextField();
            jlb_resultado1 = new javax.swing.JLabel();
            jPanel2 = new javax.swing.JPanel();
            jScrollPane4 = new javax.swing.JScrollPane();
            jtbl_distribucionfotos = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                jLabel19 = new javax.swing.JLabel();
                jLabel20 = new javax.swing.JLabel();
                jrbtn_columnaclave2 = new javax.swing.JRadioButton();
                jRadioButton2 = new javax.swing.JRadioButton();
                jrbtn_item2 = new javax.swing.JRadioButton();
                jLabel21 = new javax.swing.JLabel();
                jtf_buscarenjtable2 = new javax.swing.JTextField();
                jlb_resultado2 = new javax.swing.JLabel();
                jPanel4 = new javax.swing.JPanel();
                jScrollPane6 = new javax.swing.JScrollPane();
                jt_articulosestadisticas = new javax.swing.JTable()
                {
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        return false;
                    }
                }
                ;
                jPanel5 = new javax.swing.JPanel();
                jPanel6 = new javax.swing.JPanel();
                jButton1 = new javax.swing.JButton();
                jMenuBar1 = new javax.swing.JMenuBar();
                jMenu1 = new javax.swing.JMenu();
                jmni_salir = new javax.swing.JMenuItem();
                jMenu2 = new javax.swing.JMenu();
                jmni_escape = new javax.swing.JMenuItem();
                jMenu3 = new javax.swing.JMenu();

                setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_promociones_detalle.class);
                setTitle(resourceMap.getString("Form.title")); // NOI18N
                setName("Form"); // NOI18N

                jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
                jPanel3.setName("jPanel3"); // NOI18N

                jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                jLabel6.setName("jLabel6"); // NOI18N

                jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                jLabel5.setName("jLabel5"); // NOI18N

                jtf_descripcion.setEditable(false);
                jtf_descripcion.setFont(resourceMap.getFont("jtf_descripcion.font")); // NOI18N
                jtf_descripcion.setName("jtf_descripcion"); // NOI18N
                jtf_descripcion.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_descripcionActionPerformed(evt);
                    }
                });

                jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                jLabel4.setName("jLabel4"); // NOI18N

                tf_status.setEditable(false);
                tf_status.setFont(resourceMap.getFont("tf_status.font")); // NOI18N
                tf_status.setName("tf_status"); // NOI18N

                jtf_importecostopromo.setEditable(false);
                jtf_importecostopromo.setFont(resourceMap.getFont("jtf_importecostopromo.font")); // NOI18N
                jtf_importecostopromo.setName("jtf_importecostopromo"); // NOI18N
                jtf_importecostopromo.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_importecostopromoActionPerformed(evt);
                    }
                });

                jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                jLabel3.setName("jLabel3"); // NOI18N

                jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
                jLabel2.setName("jLabel2"); // NOI18N

                jtf_piezaspromo.setEditable(false);
                jtf_piezaspromo.setFont(resourceMap.getFont("jtf_piezaspromo.font")); // NOI18N
                jtf_piezaspromo.setName("jtf_piezaspromo"); // NOI18N

                jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                jLabel1.setName("jLabel1"); // NOI18N

                jtf_fechaaplica.setEditable(false);
                jtf_fechaaplica.setFont(resourceMap.getFont("jtf_fechaaplica.font")); // NOI18N
                jtf_fechaaplica.setName("jtf_fechaaplica"); // NOI18N
                jtf_fechaaplica.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_fechaaplicaActionPerformed(evt);
                    }
                });

                jtf_fechainicio.setEditable(false);
                jtf_fechainicio.setFont(resourceMap.getFont("jtf_fechainicio.font")); // NOI18N
                jtf_fechainicio.setName("jtf_fechainicio"); // NOI18N
                jtf_fechainicio.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_fechainicioActionPerformed(evt);
                    }
                });

                jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                jLabel7.setName("jLabel7"); // NOI18N

                jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
                jLabel10.setName("jLabel10"); // NOI18N

                jtf_fechafinal.setEditable(false);
                jtf_fechafinal.setFont(resourceMap.getFont("jtf_fechafinal.font")); // NOI18N
                jtf_fechafinal.setName("jtf_fechafinal"); // NOI18N
                jtf_fechafinal.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_fechafinalActionPerformed(evt);
                    }
                });

                jScrollPane2.setName("jScrollPane2"); // NOI18N

                jep_observaciones.setContentType(resourceMap.getString("jep_observaciones.contentType")); // NOI18N
                jep_observaciones.setEditable(false);
                jep_observaciones.setName("jep_observaciones"); // NOI18N
                jScrollPane2.setViewportView(jep_observaciones);

                jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                jLabel8.setName("jLabel8"); // NOI18N

                jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
                jLabel9.setName("jLabel9"); // NOI18N

                jtf_importeprecio.setEditable(false);
                jtf_importeprecio.setText(resourceMap.getString("jtf_importeprecio.text")); // NOI18N
                jtf_importeprecio.setName("jtf_importeprecio"); // NOI18N

                jtf_piezasacumvendidas.setEditable(false);
                jtf_piezasacumvendidas.setFont(resourceMap.getFont("jtf_piezasacumvendidas.font")); // NOI18N
                jtf_piezasacumvendidas.setName("jtf_piezasacumvendidas"); // NOI18N

                jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
                jLabel11.setName("jLabel11"); // NOI18N

                jtf_importeacumvendcosto.setEditable(false);
                jtf_importeacumvendcosto.setFont(resourceMap.getFont("jtf_importeacumvendcosto.font")); // NOI18N
                jtf_importeacumvendcosto.setName("jtf_importeacumvendcosto"); // NOI18N
                jtf_importeacumvendcosto.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_importeacumvendcostoActionPerformed(evt);
                    }
                });

                jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
                jLabel12.setName("jLabel12"); // NOI18N

                jtf_acumventimporprecio.setEditable(false);
                jtf_acumventimporprecio.setName("jtf_acumventimporprecio"); // NOI18N

                jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
                jLabel13.setName("jLabel13"); // NOI18N

                jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
                jLabel15.setName("jLabel15"); // NOI18N

                jtf_folio.setEditable(false);
                jtf_folio.setText(resourceMap.getString("jtf_folio.text")); // NOI18N
                jtf_folio.setName("jtf_folio"); // NOI18N

                javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                jPanel3.setLayout(jPanel3Layout);
                jPanel3Layout.setHorizontalGroup(
                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel7)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jtf_fechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel2)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jtf_piezaspromo, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel3))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGap(33, 33, 33)
                                        .addComponent(jLabel8)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel10)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jtf_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel6)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jtf_importecostopromo, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel9)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jtf_importeprecio, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_piezasacumvendidas, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel11)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jtf_importeacumvendcosto, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(32, 32, 32)
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jtf_acumventimporprecio, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(129, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_folio, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_fechaaplica, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(99, 99, 99))
                );
                jPanel3Layout.setVerticalGroup(
                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_fechaaplica, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(jtf_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5)
                            .addComponent(jLabel15)
                            .addComponent(jtf_folio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jtf_fechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel10)
                                        .addComponent(jtf_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel6)
                                        .addComponent(jLabel8))
                                    .addComponent(jLabel7)))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(11, 11, 11)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jtf_piezaspromo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_importecostopromo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)
                            .addComponent(jtf_importeprecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jtf_acumventimporprecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13)
                            .addComponent(jtf_piezasacumvendidas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_importeacumvendcosto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap())
                );

                jTabbedPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
                jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                    public void stateChanged(javax.swing.event.ChangeEvent evt) {
                        jTabbedPane1StateChanged(evt);
                    }
                });

                jPanel1.setName("jPanel1"); // NOI18N

                jScrollPane1.setName("jScrollPane1"); // NOI18N

                jtb_catalogo_articulos.setModel(this.jtable_modelo);
                jtb_catalogo_articulos.setName("jtb_catalogo_articulos"); // NOI18N
                jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                        jtb_catalogo_articulosMouseClicked(evt);
                        if(evt.getClickCount() >= 2)
                        {
                            dioclick(evt);
                            //System.out.println(" double click" );

                        }
                    }
                });
                jScrollPane1.setViewportView(jtb_catalogo_articulos);

                jLabel14.setFont(resourceMap.getFont("jLabel14.font")); // NOI18N
                jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
                jLabel14.setName("jLabel14"); // NOI18N

                jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
                jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
                jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

                jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
                jLabel22.setName("jLabel22"); // NOI18N

                jLabel23.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
                jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
                jLabel23.setName("jLabel23"); // NOI18N

                buttonGroup2.add(jrbtn_columnaclave1);
                jrbtn_columnaclave1.setText(resourceMap.getString("jrbtn_columnaclave1.text")); // NOI18N
                jrbtn_columnaclave1.setActionCommand(resourceMap.getString("jrbtn_columnaclave1.actionCommand")); // NOI18N
                jrbtn_columnaclave1.setName("jrbtn_columnaclave1"); // NOI18N
                jrbtn_columnaclave1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jrbtn_columnaclave1ActionPerformed(evt);
                    }
                });

                buttonGroup2.add(jRadioButton1);
                jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
                jRadioButton1.setActionCommand(resourceMap.getString("jRadioButton1.actionCommand")); // NOI18N
                jRadioButton1.setName("jRadioButton1"); // NOI18N
                jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jRadioButton1ActionPerformed(evt);
                    }
                });

                buttonGroup2.add(jrbtn_item1);
                jrbtn_item1.setText(resourceMap.getString("jrbtn_item1.text")); // NOI18N
                jrbtn_item1.setActionCommand(resourceMap.getString("jrbtn_item1.actionCommand")); // NOI18N
                jrbtn_item1.setName("jrbtn_item1"); // NOI18N
                jrbtn_item1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jrbtn_item1ActionPerformed(evt);
                    }
                });

                jLabel24.setFont(resourceMap.getFont("jLabel24.font")); // NOI18N
                jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
                jLabel24.setName("jLabel24"); // NOI18N

                jtf_buscarenjtable1.setName("jtf_buscarenjtable1"); // NOI18N
                jtf_buscarenjtable1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_buscarenjtable1ActionPerformed(evt);
                    }
                });

                jlb_resultado1.setFont(resourceMap.getFont("jlb_resultado1.font")); // NOI18N
                jlb_resultado1.setText(resourceMap.getString("jlb_resultado1.text")); // NOI18N
                jlb_resultado1.setName("jlb_resultado1"); // NOI18N

                javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                jPanel1.setLayout(jPanel1Layout);
                jPanel1Layout.setHorizontalGroup(
                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(322, 322, 322)
                                .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel14))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel22)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel23)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jrbtn_columnaclave1)
                                .addGap(9, 9, 9)
                                .addComponent(jRadioButton1)
                                .addGap(18, 18, 18)
                                .addComponent(jrbtn_item1)
                                .addGap(30, 30, 30)
                                .addComponent(jLabel24)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_buscarenjtable1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jlb_resultado1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(207, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1024, Short.MAX_VALUE)
                            .addContainerGap()))
                );
                jPanel1Layout.setVerticalGroup(
                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(jlbl_cantidadregistros))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 368, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel22)
                            .addComponent(jLabel23)
                            .addComponent(jrbtn_columnaclave1)
                            .addComponent(jRadioButton1)
                            .addComponent(jlb_resultado1)
                            .addComponent(jtf_buscarenjtable1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel24)
                            .addComponent(jrbtn_item1))
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addContainerGap(44, Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 339, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(44, 44, 44)))
                );

                jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

                jPanel2.setName("jPanel2"); // NOI18N

                jScrollPane4.setName("jScrollPane4"); // NOI18N

                jtbl_distribucionfotos.setModel(this.jtable_modelo_fotos);
                jtbl_distribucionfotos.setName("jtbl_distribucionfotos"); // NOI18N
                jtbl_distribucionfotos.addMouseListener(new java.awt.event.MouseAdapter() {
                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                        jtbl_distribucionfotosMouseClicked(evt);
                        if(evt.getClickCount() >= 2)
                        {
                            dioclickf(evt);
                        }
                    }
                });
                jScrollPane4.setViewportView(jtbl_distribucionfotos);

                jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
                jLabel19.setName("jLabel19"); // NOI18N

                jLabel20.setFont(resourceMap.getFont("jLabel20.font")); // NOI18N
                jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
                jLabel20.setName("jLabel20"); // NOI18N

                buttonGroup1.add(jrbtn_columnaclave2);
                jrbtn_columnaclave2.setText(resourceMap.getString("jrbtn_columnaclave2.text")); // NOI18N
                jrbtn_columnaclave2.setActionCommand(resourceMap.getString("jrbtn_columnaclave2.actionCommand")); // NOI18N
                jrbtn_columnaclave2.setName("jrbtn_columnaclave2"); // NOI18N
                jrbtn_columnaclave2.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jrbtn_columnaclave2ActionPerformed(evt);
                    }
                });

                buttonGroup1.add(jRadioButton2);
                jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
                jRadioButton2.setActionCommand(resourceMap.getString("jRadioButton2.actionCommand")); // NOI18N
                jRadioButton2.setName("jRadioButton2"); // NOI18N
                jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jRadioButton2ActionPerformed(evt);
                    }
                });

                buttonGroup1.add(jrbtn_item2);
                jrbtn_item2.setText(resourceMap.getString("jrbtn_item2.text")); // NOI18N
                jrbtn_item2.setActionCommand(resourceMap.getString("jrbtn_item2.actionCommand")); // NOI18N
                jrbtn_item2.setName("jrbtn_item2"); // NOI18N
                jrbtn_item2.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jrbtn_item2ActionPerformed(evt);
                    }
                });

                jLabel21.setFont(resourceMap.getFont("jLabel21.font")); // NOI18N
                jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
                jLabel21.setName("jLabel21"); // NOI18N

                jtf_buscarenjtable2.setName("jtf_buscarenjtable2"); // NOI18N
                jtf_buscarenjtable2.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jtf_buscarenjtable2ActionPerformed(evt);
                    }
                });

                jlb_resultado2.setFont(resourceMap.getFont("jlb_resultado2.font")); // NOI18N
                jlb_resultado2.setText(resourceMap.getString("jlb_resultado2.text")); // NOI18N
                jlb_resultado2.setName("jlb_resultado2"); // NOI18N

                javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                jPanel2.setLayout(jPanel2Layout);
                jPanel2Layout.setHorizontalGroup(
                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrbtn_columnaclave2)
                        .addGap(9, 9, 9)
                        .addComponent(jRadioButton2)
                        .addGap(18, 18, 18)
                        .addComponent(jrbtn_item2)
                        .addGap(30, 30, 30)
                        .addComponent(jLabel21)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_buscarenjtable2, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jlb_resultado2, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(207, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1034, Short.MAX_VALUE))
                );
                jPanel2Layout.setVerticalGroup(
                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addContainerGap(395, Short.MAX_VALUE)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20)
                            .addComponent(jrbtn_columnaclave2)
                            .addComponent(jRadioButton2)
                            .addComponent(jlb_resultado2)
                            .addComponent(jtf_buscarenjtable2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel21)
                            .addComponent(jrbtn_item2))
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 372, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(55, Short.MAX_VALUE)))
                );

                jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

                jPanel4.setName("jPanel4"); // NOI18N

                jScrollPane6.setName("jScrollPane6"); // NOI18N

                jt_articulosestadisticas.setModel(this.jtable_modelo_articyestadis);
                jt_articulosestadisticas.setName("jt_articulosestadisticas"); // NOI18N
                jt_articulosestadisticas.addMouseListener(new java.awt.event.MouseAdapter() {
                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                        jt_articulosestadisticasMouseClicked(evt);
                        if(evt.getClickCount() >= 2)
                        {
                            dioclicke(evt);
                        }
                    }
                });
                jScrollPane6.setViewportView(jt_articulosestadisticas);

                javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                jPanel4.setLayout(jPanel4Layout);
                jPanel4Layout.setHorizontalGroup(
                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 1034, Short.MAX_VALUE)
                );
                jPanel4Layout.setVerticalGroup(
                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE)
                        .addContainerGap())
                );

                jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

                jPanel5.setName("jPanel5"); // NOI18N

                jPanel6.setName("jPanel6"); // NOI18N

                jButton1.setIcon(resourceMap.getIcon("jButton1.icon")); // NOI18N
                jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
                jButton1.setName("jButton1"); // NOI18N
                jButton1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jButton1ActionPerformed(evt);
                    }
                });

                javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                jPanel6.setLayout(jPanel6Layout);
                jPanel6Layout.setHorizontalGroup(
                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton1)
                        .addContainerGap(871, Short.MAX_VALUE))
                );
                jPanel6Layout.setVerticalGroup(
                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton1)
                        .addContainerGap(120, Short.MAX_VALUE))
                );

                javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                jPanel5.setLayout(jPanel5Layout);
                jPanel5Layout.setHorizontalGroup(
                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                );
                jPanel5Layout.setVerticalGroup(
                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(260, Short.MAX_VALUE))
                );

                jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

                jMenuBar1.setName("jMenuBar1"); // NOI18N

                jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                jMenu1.setName("jMenu1"); // NOI18N

                jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                jmni_salir.setName("jmni_salir"); // NOI18N
                jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jmni_salirActionPerformed(evt);
                    }
                });
                jMenu1.add(jmni_salir);

                jMenuBar1.add(jMenu1);

                jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
                jMenu2.setName("jMenu2"); // NOI18N

                jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                jmni_escape.setName("jmni_escape"); // NOI18N
                jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jmni_escapeActionPerformed(evt);
                    }
                });
                jMenu2.add(jmni_escape);

                jMenuBar1.add(jMenu2);

                jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
                jMenu3.setName("jMenu3"); // NOI18N
                jMenuBar1.add(jMenu3);

                setJMenuBar(jMenuBar1);

                javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                getContentPane().setLayout(layout);
                layout.setHorizontalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1043, Short.MAX_VALUE)
                );
                layout.setVerticalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE))
                );

                pack();
            }// </editor-fold>//GEN-END:initComponents

    private void jtf_descripcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_descripcionActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_descripcionActionPerformed

    private void jtf_importecostopromoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_importecostopromoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_importecostopromoActionPerformed

    private void jtf_fechaaplicaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fechaaplicaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_fechaaplicaActionPerformed

    private void jtf_fechainicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fechainicioActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_fechainicioActionPerformed

    private void jtf_fechafinalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fechafinalActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_fechafinalActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jtf_importeacumvendcostoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_importeacumvendcostoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_importeacumvendcostoActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
           indexactual=this.jTabbedPane1.getSelectedIndex();
           if((indexactual==1)&&(yacarguedistrifotos==0))
            {
               yacarguedistrifotos=1;
               this.distribucionfotos();
            }
           if((indexactual==2)&&(yacargueestadistica==0))
            {
                yacargueestadistica=1;
                this.cargar_datosarticulosexisyacum(0, this.jtf_folio.getText());
            }

    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jrbtn_columnaclave2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa2=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_columnaclave2ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa2=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jrbtn_item2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_item2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa2=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_item2ActionPerformed

    private void jtf_buscarenjtable2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtable2ActionPerformed
        // TODO add your handling code here:
        this.find_textoenjtable2(columnavisualisa2, 0, this.jtf_buscarenjtable2.getText().toUpperCase().trim());
}//GEN-LAST:event_jtf_buscarenjtable2ActionPerformed

    private void jrbtn_columnaclave1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa1=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_columnaclave1ActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa1=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jrbtn_item1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_item1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa1=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_item1ActionPerformed

    private void jtf_buscarenjtable1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtable1ActionPerformed
        // TODO add your handling code here:
    this.find_textoenjtable1(columnavisualisa1, 0, this.jtf_buscarenjtable1.getText().toUpperCase().trim());
}//GEN-LAST:event_jtf_buscarenjtable1ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
    if(JOptionPane.showConfirmDialog(null, "Desea Actualizar las Estadisticas?")==0)
        {
        String cadenasql="select * from x1sieuno_articulo_promociones_actualiza(1,'"+this.jtf_folio.getText()+"','','','','');",retorno="";
       //invoco al metodo que trae el recordset de datos
       System.out.println(cadenasql);

        try
         {
            rs = x.sieuno_executediversosv2(cadenasql,variables_global.getconexiongral());
            while (rs.next())
                {
                    retorno=rs.getString(1);
                }
        }
        catch(Exception e)
        {
                System.out.println(e.getMessage());
        }
        if (retorno.equals("1"))
            {
                JOptionPane.showMessageDialog(null,"Estadistica Actualizada Correctamente!!", "Sistema Integral Promociones",1);
            }
        }
    }//GEN-LAST:event_jButton1ActionPerformed

private void jtb_catalogo_articulosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
}

private void distribucionfotos()
    {
        int numerofilas=this.jtable_modelo_fotos.getRowCount(),i=0;
        String valor = "";
        for( i=0;i<numerofilas;i++)
                {
                    jtbl_distribucionfotos.setRowHeight(i, 140);
                    valor=jtbl_distribucionfotos.getValueAt(i, 1).toString();
                    jtable_modelo_fotos.setValueAt("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+valor+".JPG\" width=\"180\" height=\"120\" border=\"0\" alt=\"Foto\"></img></p></body></html>",i,4);
                }
    }

private void find_textoenjtable1(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo.getRowCount(),i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtb_catalogo_articulos.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado2.setText("Resultado:"+this.jtf_buscarenjtable1.getText()+"="+coincidencias);
    }


private void find_textoenjtable2(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo_fotos.getRowCount(),i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_fotos.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtbl_distribucionfotos.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado2.setText("Resultado:"+this.jtf_buscarenjtable2.getText()+"="+coincidencias);
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new articulos_sie_promociones_detalle().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JEditorPane jep_observaciones;
    private javax.swing.JLabel jlb_resultado1;
    private javax.swing.JLabel jlb_resultado2;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrbtn_columnaclave1;
    private javax.swing.JRadioButton jrbtn_columnaclave2;
    private javax.swing.JRadioButton jrbtn_item1;
    private javax.swing.JRadioButton jrbtn_item2;
    private javax.swing.JTable jt_articulosestadisticas;
    private javax.swing.JTable jtb_catalogo_articulos;
    private javax.swing.JTable jtbl_distribucionfotos;
    private javax.swing.JTextField jtf_acumventimporprecio;
    private javax.swing.JTextField jtf_buscarenjtable1;
    private javax.swing.JTextField jtf_buscarenjtable2;
    private javax.swing.JTextField jtf_descripcion;
    private javax.swing.JTextField jtf_fechaaplica;
    private javax.swing.JTextField jtf_fechafinal;
    private javax.swing.JTextField jtf_fechainicio;
    private javax.swing.JTextField jtf_folio;
    private javax.swing.JTextField jtf_importeacumvendcosto;
    private javax.swing.JTextField jtf_importecostopromo;
    private javax.swing.JTextField jtf_importeprecio;
    private javax.swing.JTextField jtf_piezasacumvendidas;
    private javax.swing.JTextField jtf_piezaspromo;
    private javax.swing.JTextField tf_status;
    // End of variables declaration//GEN-END:variables

}
